package uml.behavioral.mediator;

/**
 * 中介者--具体同事<br>
 * on 2023/1/2 22:27
 */
public class QQUser extends User {

    public QQUser(String name) {
        super(name);
    }

    @Override
    public void sendMessage(Mediator group, String msg) {
        group.setMsgSender(this);//将自己设为消息发送者
        this.msg = msg;
        if (groups.contains(group)) {
            group.chatInGroup();
        }else {
            System.out.println(name+"还未加入群聊,是否立即加入"+group.getName()+"?");
        }
    }

}
